package cate.game.role.bag.rune;

import cp.solution.util.collection.ListKit;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@NoteClass(value = "徽章重铸属性技能的缓存")
public class ReCastTemp {
    @NoteField(value = "属性Id们")
    public List<Integer> attrIds;

    @NoteField(value = "技能id们")
    public List<Integer> skillIds;

    @NoteField(value = "进阶属性id")
    public List<Integer> gradeAttrIds;

    public void initialize() {
        if (attrIds == null) {
            attrIds = new ArrayList<>();
        }
        if (skillIds == null) {
            skillIds = new ArrayList<>();
        }
        if (gradeAttrIds == null) {
            gradeAttrIds = new ArrayList<>();
        }
    }

    public void clear() {
        attrIds.clear();
        skillIds.clear();
        gradeAttrIds.clear();
    }

    public ReCastTemp copy() {
        ReCastTemp cp = new ReCastTemp();
        cp.attrIds = ListKit.cloneList(this.attrIds, Integer::intValue);
        cp.skillIds = ListKit.cloneList(this.skillIds, Integer::intValue);
        cp.gradeAttrIds = ListKit.cloneList(this.gradeAttrIds, Integer::intValue);
        return cp;
    }
}
